<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Array Test</title>
<script type="text/javascript" src="../liwe.js"></script>
<script type="text/javascript" src="../utils.js"></script>
<script type="text/javascript" src="../object_enh.js"></script>
<script type="text/javascript" src="../array_enh.js"></script>
<script type="text/javascript" src="../string_enh.js"></script>
<script type="text/javascript">
function test_fromform ()
{
	var a = Array.fromForm ( 'my_form' );

	alert ( a.debugDump () );
} 

function test_map ()
{
	var a = Array.fromForm ( 'my_form' );
	a.map ( alert );
}

function test_delkey ()
{
	var a = Array.fromForm ( 'my_form' );
	alert ( a.debugDump () );
	a.delKey ( 'login' );
	alert ( a.debugDump () );
}

function test_del ()
{
	var a = Array.fromForm ( 'my_form' );
	alert ( a.debugDump () );
	a.del ( 1 );
	alert ( a.debugDump () );
}

function test_count ()
{
        var a = Array.fromForm ( 'my_form' );
	var num = a.count ();
	alert ( num );
}

</script>
</head> 
<body>

<table id="my_form">
<tr><td>login:</td><td><input type="text" name="login" /></td></tr>
<tr><td>passwd:</td><td><input type="password" name="passwd" /></td></tr>
<tr><td>passwd:</td><td><textarea name="txtarea">hello world!</textarea></td></tr>
<tr><td>passwd:</td><td><input type="checkbox" name="cbox" value="1"/></td></tr>
<tr><td>passwd:</td><td>
	<input type="radio" name="r1" value="1"/> 1<br />
	<input type="radio" name="r1" value="2"/> 2<br />
	<input type="radio" name="r1" value="3"/> 3<br />
</td></tr>
<tr><td>select:</td><td><select name="sel">
<option value="1">Item 1</option>
<option value="2">Item 2</option>
<option value="3">Item 3</option>
<option value="4">Item 4</option>
</select></td></tr>
<tr><td colspan="2" align="center"><a href="javascript:test_fromform()">Get Values</a></td></tr>
<tr><td colspan="2" align="center"><a href="javascript:test_map()">Test map()</a></td></tr>
<tr><td colspan="2" align="center"><a href="javascript:test_delkey()">Test delKey()</a></td></tr>
<tr><td colspan="2" align="center"><a href="javascript:test_del()">Test del()</a></td></tr>
<tr><td colspan="2" align="center"><a href="javascript:test_count()">Test count()</a></td></tr>
</table>


</body>
</html>
